// 443
    public static int compress(char[] chars) {
        ArrayList<Character> arrayList=new ArrayList<>();
        char curChar=chars[0];
        arrayList.add(curChar);
        int local=0;
        int curCount=0;
        while(local<chars.length){
            if(chars[local]==curChar){
                curCount++;
            }else{
                if(curCount!=1) {
                    char[] count = String.valueOf(curCount).toCharArray();
                    for (int i = 0; i < count.length; i++) {
                        arrayList.add(count[i]);
                    }
                }
                curCount=1;
                curChar=chars[local];
                arrayList.add(curChar);
            }
            local++;
        }
        if(curCount!=1) {
            char[] count = String.valueOf(curCount).toCharArray();
            for (int i = 0; i < count.length; i++) {
                arrayList.add(count[i]);
            }
        }
        for(int i=0;i<arrayList.size();i++){
            chars[i]=arrayList.get(i);
        }
//        for(int i=0;i<arrayList.size();i++){
//            System.out.print(arrayList.get(i)+" ");
//        }
//        System.out.println();
        return arrayList.size();
    }